import weka.classifiers.trees.J48;
import weka.core.Instances;
import weka.core.converters.ArffLoader;
import java.io.File;

public class J48Classifier {
   public static void main(String[] args) throws Exception {
	   ArffLoader loader=new ArffLoader();
	   loader.setFile(new File("src/main/resources/source/weather.numeric.arff"));
	   Instances data=loader.getDataSet();
	   data.setClassIndex(data.numAttributes()-1);
	   
	   String[] options=new String[1];
	   options[0]="-U";
	   J48 tree=new J48();
	   tree.setOptions(options);
	   tree.buildClassifier(data);
	   
	   System.out.println(tree);
   }
}